package com.rjet.view_demo1;

import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.view.View;
import android.widget.LinearLayout;

//倒圆角工具
public class CornerMaker {

    public static void makeCorner(View view, float radius, int argb){

        GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setShape(GradientDrawable.RECTANGLE);
        gradientDrawable.setColor(argb);
        gradientDrawable.setCornerRadius(radius); // 圆角半径
        view.setBackground(gradientDrawable);
    }
}
